3.1.76 \(\int x^2 (d+e x) (a+b \log (c x^n))^2 \, dx\) [76]

Optimal. Leaf size=109 \[ \frac {2}{27} b^2 d n^2 x^3+\frac {1}{32} b^2 e n^2 x^4-\frac {2}{9} b d n x^3 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{8} b e n x^4 \left (a+b \log \left (c x^n\right )\right )+\frac {1}{3} d x^3 \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{4} e x^4 \left (a+b \log \left (c x^n\right )\right )^2 \]

[Out]

2/27*b^2*d*n^2*x^3+1/32*b^2*e*n^2*x^4-2/9*b*d*n*x^3*(a+b*ln(c*x^n))-1/8*b*e*n*x^4*(a+b*ln(c*x^n))+1/3*d*x^3*(a
+b*ln(c*x^n))^2+1/4*e*x^4*(a+b*ln(c*x^n))^2

________________________________________________________________________________________

Rubi [A]
time = 0.11, antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2395, 2342, 2341} \begin {gather*} \frac {1}{3} d x^3 \left (a+b \log \left (c x^n\right )\right )^2-\frac {2}{9} b d n x^3 \left (a+b \log \left (c x^n\right )\right )+\frac {1}{4} e x^4 \left (a+b \log \left (c x^n\right )\right )^2-\frac {1}{8} b e n x^4 \left (a+b \log \left (c x^n\right )\right )+\frac {2}{27} b^2 d n^2 x^3+\frac {1}{32} b^2 e n^2 x^4 \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^2*(d + e*x)*(a + b*Log[c*x^n])^2,x]

[Out]

(2*b^2*d*n^2*x^3)/27 + (b^2*e*n^2*x^4)/32 - (2*b*d*n*x^3*(a + b*Log[c*x^n]))/9 - (b*e*n*x^4*(a + b*Log[c*x^n])
)/8 + (d*x^3*(a + b*Log[c*x^n])^2)/3 + (e*x^4*(a + b*Log[c*x^n])^2)/4

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2395

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rubi steps

\begin {align*} \int x^2 (d+e x) \left (a+b \log \left (c x^n\right )\right )^2 \, dx &=\int \left (d x^2 \left (a+b \log \left (c x^n\right )\right )^2+e x^3 \left (a+b \log \left (c x^n\right )\right )^2\right ) \, dx\\ &=d \int x^2 \left (a+b \log \left (c x^n\right )\right )^2 \, dx+e \int x^3 \left (a+b \log \left (c x^n\right )\right )^2 \, dx\\ &=\frac {1}{3} d x^3 \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{4} e x^4 \left (a+b \log \left (c x^n\right )\right )^2-\frac {1}{3} (2 b d n) \int x^2 \left (a+b \log \left (c x^n\right )\right ) \, dx-\frac {1}{2} (b e n) \int x^3 \left (a+b \log \left (c x^n\right )\right ) \, dx\\ &=\frac {2}{27} b^2 d n^2 x^3+\frac {1}{32} b^2 e n^2 x^4-\frac {2}{9} b d n x^3 \left (a+b \log \left (c x^n\right )\right )-\frac {1}{8} b e n x^4 \left (a+b \log \left (c x^n\right )\right )+\frac {1}{3} d x^3 \left (a+b \log \left (c x^n\right )\right )^2+\frac {1}{4} e x^4 \left (a+b \log \left (c x^n\right )\right )^2\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 82, normalized size = 0.75 \begin {gather*} \frac {1}{864} x^3 \left (27 b e n x \left (-4 a+b n-4 b \log \left (c x^n\right )\right )+64 b d n \left (-3 a+b n-3 b \log \left (c x^n\right )\right )+288 d \left (a+b \log \left (c x^n\right )\right )^2+216 e x \left (a+b \log \left (c x^n\right )\right )^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^2*(d + e*x)*(a + b*Log[c*x^n])^2,x]

[Out]

(x^3*(27*b*e*n*x*(-4*a + b*n - 4*b*Log[c*x^n]) + 64*b*d*n*(-3*a + b*n - 3*b*Log[c*x^n]) + 288*d*(a + b*Log[c*x
^n])^2 + 216*e*x*(a + b*Log[c*x^n])^2))/864

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.08, size = 1622, normalized size = 14.88

method result size
risch \(\text {Expression too large to display}\) \(1622\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(e*x+d)*(a+b*ln(c*x^n))^2,x,method=_RETURNVERBOSE)

[Out]

1/4*x^4*a^2*e+1/3*x^3*a^2*d+1/72*b*(-18*I*Pi*b*e*x^4*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+18*I*Pi*b*e*x^4*csgn(
I*c)*csgn(I*c*x^n)^2+18*I*Pi*b*e*x^4*csgn(I*x^n)*csgn(I*c*x^n)^2-18*I*Pi*b*e*x^4*csgn(I*c*x^n)^3+36*ln(c)*b*e*
x^4-9*b*e*n*x^4+36*x^4*a*e-24*I*Pi*b*d*x^3*csgn(I*c)*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2*csgn(I*c*x^n)^3-1/3*I*Pi*a*b*d*x^3*csgn(I*c*x^n)^3-1
/3*I*Pi*ln(c)*b^2*d*x^3*csgn(I*c*x^n)^3+1/9*I*Pi*b^2*d*n*x^3*csgn(I*c*x^n)^3+1/6*Pi^2*b^2*d*x^3*csgn(I*c)^2*cs
gn(I*x^n)*csgn(I*c*x^n)^3+1/16*I*Pi*b^2*e*n*x^4*csgn(I*c*x^n)^3-1/4*I*Pi*a*b*e*x^4*csgn(I*c*x^n)^3-1/4*I*Pi*ln
(c)*b^2*e*x^4*csgn(I*c*x^n)^3+1/6*Pi^2*b^2*d*x^3*csgn(I*c)*csgn(I*x^n)^2*csgn(I*c*x^n)^3-1/3*Pi^2*b^2*d*x^3*cs
gn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)^4

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 156, normalized size = 1.43 \begin {gather*} \frac {1}{4} \, b^{2} x^{4} e \log \left (c x^{n}\right )^{2} - \frac {1}{8} \, a b n x^{4} e + \frac {1}{2} \, a b x^{4} e \log \left (c x^{n}\right ) + \frac {1}{3} \, b^{2} d x^{3} \log \left (c x^{n}\right )^{2} - \frac {2}{9} \, a b d n x^{3} + \frac {1}{4} \, a^{2} x^{4} e + \frac {2}{3} \, a b d x^{3} \log \left (c x^{n}\right ) + \frac {1}{3} \, a^{2} d x^{3} + \frac {2}{27} \, {\left (n^{2} x^{3} - 3 \, n x^{3} \log \left (c x^{n}\right )\right )} b^{2} d + \frac {1}{32} \, {\left (n^{2} x^{4} - 4 \, n x^{4} \log \left (c x^{n}\right )\right )} b^{2} e \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="maxima")

[Out]

1/4*b^2*x^4*e*log(c*x^n)^2 - 1/8*a*b*n*x^4*e + 1/2*a*b*x^4*e*log(c*x^n) + 1/3*b^2*d*x^3*log(c*x^n)^2 - 2/9*a*b
*d*n*x^3 + 1/4*a^2*x^4*e + 2/3*a*b*d*x^3*log(c*x^n) + 1/3*a^2*d*x^3 + 2/27*(n^2*x^3 - 3*n*x^3*log(c*x^n))*b^2*
d + 1/32*(n^2*x^4 - 4*n*x^4*log(c*x^n))*b^2*e

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 221 vs. \(2 (100) = 200\).
time = 0.35, size = 221, normalized size = 2.03 \begin {gather*} \frac {1}{32} \, {\left (b^{2} n^{2} - 4 \, a b n + 8 \, a^{2}\right )} x^{4} e + \frac {1}{27} \, {\left (2 \, b^{2} d n^{2} - 6 \, a b d n + 9 \, a^{2} d\right )} x^{3} + \frac {1}{12} \, {\left (3 \, b^{2} x^{4} e + 4 \, b^{2} d x^{3}\right )} \log \left (c\right )^{2} + \frac {1}{12} \, {\left (3 \, b^{2} n^{2} x^{4} e + 4 \, b^{2} d n^{2} x^{3}\right )} \log \left (x\right )^{2} - \frac {1}{72} \, {\left (9 \, {\left (b^{2} n - 4 \, a b\right )} x^{4} e + 16 \, {\left (b^{2} d n - 3 \, a b d\right )} x^{3}\right )} \log \left (c\right ) - \frac {1}{72} \, {\left (9 \, {\left (b^{2} n^{2} - 4 \, a b n\right )} x^{4} e + 16 \, {\left (b^{2} d n^{2} - 3 \, a b d n\right )} x^{3} - 12 \, {\left (3 \, b^{2} n x^{4} e + 4 \, b^{2} d n x^{3}\right )} \log \left (c\right )\right )} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="fricas")

[Out]

1/32*(b^2*n^2 - 4*a*b*n + 8*a^2)*x^4*e + 1/27*(2*b^2*d*n^2 - 6*a*b*d*n + 9*a^2*d)*x^3 + 1/12*(3*b^2*x^4*e + 4*
b^2*d*x^3)*log(c)^2 + 1/12*(3*b^2*n^2*x^4*e + 4*b^2*d*n^2*x^3)*log(x)^2 - 1/72*(9*(b^2*n - 4*a*b)*x^4*e + 16*(
b^2*d*n - 3*a*b*d)*x^3)*log(c) - 1/72*(9*(b^2*n^2 - 4*a*b*n)*x^4*e + 16*(b^2*d*n^2 - 3*a*b*d*n)*x^3 - 12*(3*b^
2*n*x^4*e + 4*b^2*d*n*x^3)*log(c))*log(x)

________________________________________________________________________________________

Sympy [A]
time = 0.42, size = 185, normalized size = 1.70 \begin {gather*} \frac {a^{2} d x^{3}}{3} + \frac {a^{2} e x^{4}}{4} - \frac {2 a b d n x^{3}}{9} + \frac {2 a b d x^{3} \log {\left (c x^{n} \right )}}{3} - \frac {a b e n x^{4}}{8} + \frac {a b e x^{4} \log {\left (c x^{n} \right )}}{2} + \frac {2 b^{2} d n^{2} x^{3}}{27} - \frac {2 b^{2} d n x^{3} \log {\left (c x^{n} \right )}}{9} + \frac {b^{2} d x^{3} \log {\left (c x^{n} \right )}^{2}}{3} + \frac {b^{2} e n^{2} x^{4}}{32} - \frac {b^{2} e n x^{4} \log {\left (c x^{n} \right )}}{8} + \frac {b^{2} e x^{4} \log {\left (c x^{n} \right )}^{2}}{4} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(e*x+d)*(a+b*ln(c*x**n))**2,x)

[Out]

a**2*d*x**3/3 + a**2*e*x**4/4 - 2*a*b*d*n*x**3/9 + 2*a*b*d*x**3*log(c*x**n)/3 - a*b*e*n*x**4/8 + a*b*e*x**4*lo
g(c*x**n)/2 + 2*b**2*d*n**2*x**3/27 - 2*b**2*d*n*x**3*log(c*x**n)/9 + b**2*d*x**3*log(c*x**n)**2/3 + b**2*e*n*
*2*x**4/32 - b**2*e*n*x**4*log(c*x**n)/8 + b**2*e*x**4*log(c*x**n)**2/4

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 251 vs. \(2 (100) = 200\).
time = 4.62, size = 251, normalized size = 2.30 \begin {gather*} \frac {1}{4} \, b^{2} n^{2} x^{4} e \log \left (x\right )^{2} - \frac {1}{8} \, b^{2} n^{2} x^{4} e \log \left (x\right ) + \frac {1}{2} \, b^{2} n x^{4} e \log \left (c\right ) \log \left (x\right ) + \frac {1}{3} \, b^{2} d n^{2} x^{3} \log \left (x\right )^{2} + \frac {1}{32} \, b^{2} n^{2} x^{4} e - \frac {1}{8} \, b^{2} n x^{4} e \log \left (c\right ) + \frac {1}{4} \, b^{2} x^{4} e \log \left (c\right )^{2} - \frac {2}{9} \, b^{2} d n^{2} x^{3} \log \left (x\right ) + \frac {1}{2} \, a b n x^{4} e \log \left (x\right ) + \frac {2}{3} \, b^{2} d n x^{3} \log \left (c\right ) \log \left (x\right ) + \frac {2}{27} \, b^{2} d n^{2} x^{3} - \frac {1}{8} \, a b n x^{4} e - \frac {2}{9} \, b^{2} d n x^{3} \log \left (c\right ) + \frac {1}{2} \, a b x^{4} e \log \left (c\right ) + \frac {1}{3} \, b^{2} d x^{3} \log \left (c\right )^{2} + \frac {2}{3} \, a b d n x^{3} \log \left (x\right ) - \frac {2}{9} \, a b d n x^{3} + \frac {1}{4} \, a^{2} x^{4} e + \frac {2}{3} \, a b d x^{3} \log \left (c\right ) + \frac {1}{3} \, a^{2} d x^{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(e*x+d)*(a+b*log(c*x^n))^2,x, algorithm="giac")

[Out]

1/4*b^2*n^2*x^4*e*log(x)^2 - 1/8*b^2*n^2*x^4*e*log(x) + 1/2*b^2*n*x^4*e*log(c)*log(x) + 1/3*b^2*d*n^2*x^3*log(
x)^2 + 1/32*b^2*n^2*x^4*e - 1/8*b^2*n*x^4*e*log(c) + 1/4*b^2*x^4*e*log(c)^2 - 2/9*b^2*d*n^2*x^3*log(x) + 1/2*a
*b*n*x^4*e*log(x) + 2/3*b^2*d*n*x^3*log(c)*log(x) + 2/27*b^2*d*n^2*x^3 - 1/8*a*b*n*x^4*e - 2/9*b^2*d*n*x^3*log
(c) + 1/2*a*b*x^4*e*log(c) + 1/3*b^2*d*x^3*log(c)^2 + 2/3*a*b*d*n*x^3*log(x) - 2/9*a*b*d*n*x^3 + 1/4*a^2*x^4*e
 + 2/3*a*b*d*x^3*log(c) + 1/3*a^2*d*x^3

________________________________________________________________________________________

Mupad [B]
time = 3.58, size = 116, normalized size = 1.06 \begin {gather*} {\ln \left (c\,x^n\right )}^2\,\left (\frac {e\,b^2\,x^4}{4}+\frac {d\,b^2\,x^3}{3}\right )+\ln \left (c\,x^n\right )\,\left (\frac {b\,e\,\left (4\,a-b\,n\right )\,x^4}{8}+\frac {2\,b\,d\,\left (3\,a-b\,n\right )\,x^3}{9}\right )+\frac {d\,x^3\,\left (9\,a^2-6\,a\,b\,n+2\,b^2\,n^2\right )}{27}+\frac {e\,x^4\,\left (8\,a^2-4\,a\,b\,n+b^2\,n^2\right )}{32} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a + b*log(c*x^n))^2*(d + e*x),x)

[Out]

log(c*x^n)^2*((b^2*d*x^3)/3 + (b^2*e*x^4)/4) + log(c*x^n)*((2*b*d*x^3*(3*a - b*n))/9 + (b*e*x^4*(4*a - b*n))/8
) + (d*x^3*(9*a^2 + 2*b^2*n^2 - 6*a*b*n))/27 + (e*x^4*(8*a^2 + b^2*n^2 - 4*a*b*n))/32

________________________________________________________________________________________